USE [movie]
GO

/****** Object:  StoredProcedure [dbo].[mov_getCustomer]    Script Date: 05/21/2011 13:15:38 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

IF EXISTS (SELECT name FROM sysobjects WHERE name = 'mov_getCustomer' AND type = 'P') DROP PROCEDURE mov_getCustomer
GO





-- =============================================
-- Modified:    Pritam Bhat
-- Create date: 5/19/2011
-- Description:	This procedure returns customer details

-- =============================================
CREATE PROCEDURE [dbo].[mov_getCustomer] 	
(
	@email varchar(40)
)
AS
BEGIN
	
	SET NOCOUNT ON;


SELECT  cust.cus_email,cust.cus_password, cust.cus_name, cust.cus_join_date,
custadd.address1, custadd.city, st.state_long, custadd.postalcode
FROM customer cust, customer_address custadd, state st
WHERE cust.cus_ID = custadd.cus_ID 
	and custadd.state = st.state_ID
	and cust. cus_email = @email

END



GO


